Slime REPL Hook


Please note:

You need to enable this mode manually by uncommenting this line in eql-start-swank.lisp in your Slime directory:

  (setf eql:*slime-mode* :repl-hook)


Requires ECL threads.

This should work with any Slime version that plays together with ECL.
Tested with ECL 12.7.1 (Windows: ECL 12.12.1)


Prepare


Run


Notes

Eval Region

The point here is: if you directly try to Eval Region an expression containing an EQL function, your swank server will crash, because it will not be evaluated in the GUI thread (Qt GUI methods need to be called from the GUI thread).

So, only run EQL functions directly from the Slime REPL.
If you want to use Eval Region containing EQL functions, use the method described above.


You may use the macro qeval if you want to ensure evaluation in the GUI thread (this is meant to be used together with Eval Region only).
It behaves like a progn, so you can do something like this:

(qeval
  (defvar *label* (qnew "QLabel"))
  (defvar *edit*  (qnew "QLineEdit")))

Wrapping forms in qeval will have no effect if you run your code outside of Slime (so there's no need to remove qeval in your final program).


But note: the advantage using Eval Region (without qeval) is that Lisp error conditions (not driven by Qt events) will not stop/pause your EQL program (that is, Qt event processing will continue).

Instead, if there is an error in code you either enter in the Slime REPL, or run with Eval Region wrapped in qeval, the program will always pause (Qt event processing will be stopped until you take some action).


Abort / Restart

Be careful after entering the Slime debugger. If you see this:

[ABORT] Return to SLIME's top level.
[RESTART-QT-EVENTS] Last resort only - prefer "Return to SLIME's top level"

Always choose the first one, otherwise you'll be stuck.


Help

For help see the qapropos and qgui functions.